use "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Chapter 4 Campaigns\Data\Chapter 4 Net traits all four.dta", clear

*Figure 2.8
twoway (bar pointestimate2 group if n==1, base(0) barwidth(.75) color(black) lwidth(none)) ///
(bar pointestimate2 group if n==2, base(0.345) barwidth(.75) color(gs6)) ///
(bar pointestimate2 group if n==3, base(0.4908) barwidth(.75) color(gs6))   ///
(bar pointestimate2 group if n==4, base(0.5918) barwidth(.75) color(gs10)  lwidth(none))   ///
(bar pointestimate2 group if n==5, base(0.8527) barwidth(.75) color(gs14) lwidth(none))   ///
 (bar pointestimate2 group if n==6, base(0) barwidth(.75) color(black)  lwidth(none)) ///
 (bar pointestimate2 group if n==7, base(0.367) barwidth(.75) color(gs6)) ///
 (bar pointestimate2 group if n==8, base(0.5365) barwidth(.75) color(gs6))  ///
 (bar pointestimate2 group if n==9, base(0.6863) barwidth(.75) color(gs10)  lwidth(none))  ///
 (bar pointestimate2 group if n==10, base(0.8674) barwidth(.75) color(gs14) lwidth(none))  ///
  (bar pointestimate2 group if n==11, base(0) barwidth(.75) color(black)  lwidth(none)) ///
  (bar pointestimate2 group if n==12, base(0.4708) barwidth(.75) color(gs6)) ///
 (bar pointestimate2 group if n==13, base(0.694) barwidth(.75) color(gs6))  ///
 (bar pointestimate2 group if n==14, base(0.7851) barwidth(.75) color(gs10) lwidth(none))  ///
 (bar pointestimate2 group if n==15, base(0.8939) barwidth(.75) color(gs14) lwidth(none))  ///
 (bar pointestimate2 group if n==16, base(0.0) barwidth(.75) color(black) lwidth(none))  ///
 (bar pointestimate2 group if n==17, base(0.2667) barwidth(.75) color(gs6))  ///
 (bar pointestimate2 group if n==18, base(0.6545) barwidth(.75) color(gs6))  ///
 (bar pointestimate2 group if n==19, base(0.7308) barwidth(.75) color(gs10) lwidth(none))  ///
 (bar pointestimate2 group if n==20, base(0.9058) barwidth(.75) color(gs14) lwidth(none))  ///
 (scatter label group, mlab(networktype) msymbol(none) mlabcolor(white) mlabpos(0)) ///
 (scatter label group, mlab(networktype2) msymbol(none) mlabcolor(white) mlabpos(6)) ///
 (scatter label3 group, mlab(networktype_02) msymbol(none) mlabcolor(white) mlabpos(0)) ///
 (scatter label group, mlab(networktype_01) msymbol(none) mlabcolor(white) mlabsize(vsmall) mlabpos(0)) ///
  ,  xtitle("{bf:Country and Year}") xlab(4 `" "Mexico 2006" "({it:N}=1,649)" "' 3 `" "Brazil 2014" "({it:N}=1,049)" "' 2 `" "Brazil 2006" "({it:N}=1,147)" "' 1 `" "Brazil 2002" "({it:N}=2,962)" "', labsize(small)) ///
graphregion(color(white) margin(medlarge)) plotregion(lstyle(yxline) lcolor(black)) ///
ytitle("{bf:Percentage (cumulative) of}" "{bf:Opinionated Egos}")  legend(off) ylab(0 "0%" .2 "20%" .4 "40%" .6 "60%" .8 "80%"  1 "100%") ///
text(.924 1 "Disagreement" "Only", size(small) color(black)) text(.934 2 "Disagreement" "Only", size(small)) text(.945 3 "Disagreement" "Only", size(small)) text(.955 4 "Disagreement" "Only", size(small))

graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Chapter 2 Description\Figures\Net Traits all four.tif", as(tif) replace
graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Publishers\Final Manuscript\Final Figures\BAR2_8.tif", as(tif) replace width(1500)
graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Publishers\Final Manuscript\Final Figures\BAR2_8.pdf", as(pdf) replace 

